<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
 <%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">
<title>补充艺术家资料</title>
<link href="../style/css_member.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/common.js"></script>
<script src="../js/artDialog.js?skin=gray"></script>
<script src="../js/artDialog.iframeTools.js"></script>
<script type="text/javascript" src="../js/jquery-1.3.2.js"></script>
<script language="javascript" type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">

$(function(){
	$("#auctionLink").click(function(){
		art.dialog.open('${ctx}/fileUpload!uploadPrepare.do?imgType=auction&sharpId=10',{title:'上传拍卖画册封面图片',width:800,height:550,lock:true},false);
    });
    
	$("a[name='addPaintingHref']").click(function(){
		alert("请先保存拍卖预展资料");
		return false;
    });

	m1('m1_004');
});

	/**********提交前检查表单*****************/
	function checkForm(){

		var name = $.trim($("#name").val());
		if( name  ==  ""){
			$("#name").focus();
			 alert("拍卖会名称不能为空。");
			 return false;
		}

		var planningUnit =  $.trim($("#planningUnit").val());
		if( planningUnit  ==  ""){
			$("#planningUnit").val("");
			$("#planningUnit").focus();
			alert("策展单位不能为空。");
			return false;
		}

		var picImage = $("#picImage").val();
		if( picImage == "" ){
			alert("请上传拍卖画册封面图片");
			return false;
		}

		var totalCount =  $.trim($("#totalCount").val());
		if( totalCount  !=  "" &&  !IsInt(totalCount)){
			$("#totalCount").val("");
			$("#totalCount").focus();
			alert("作品数量不合法。");
			return false;
		}

		var beginningTime =  $.trim($("#beginningTime").val());
		if( beginningTime  ==  ""){
			alert("请填写开拍时间。");
			return false;
		}

		var province = $("#provinceInfoSelect").val();
		if( province == ""){
			 alert("请选择拍卖会所在省。");
			 return false;
		}

		var city = $("#cityInfoSelect").val();
		if( city == ""){
			 alert("请选择拍卖会所在市。");
			 return false;
		}
		
		var address = $.trim($("#address").val());
		if( address  ==  ""){
			$("#address").focus();
			 alert("请填写拍卖详细地址。");
			 return false;
		}
		
		if(window.confirm("确认提交？")){
			$("#auctionForm").submit();
		}
	}

</script>
</head>

<body>

<!-- 页面头部  -->
<jsp:include page="/commons/head_member.jsp"></jsp:include>

<form action="${ctx }/auction/auctionAction!save.do" method="post" id="auctionForm" name="auctionForm">
<table align="center" width="960" border="0" cellspacing="0" cellpadding="0" class="tbl_border_top">
          <tr>
            <td>&nbsp;</td>
            <td align="center" class="bt14A">填写预展资料</td>
          </tr>
          <tr>
            <td class="bt14A" align="right"><span class="style15">*</span> 拍卖会名称：</td>
            <td class="bt14A"><input name="auction.name" type="text" size="35" id="name" maxlength="40"></td>
            <td width="200" rowspan="8" class="bt14A" align="left" valign="top">
              <table width="165" height="217" border="0" cellpadding="0" cellspacing="1" bordercolor="#CCCCCC" bgcolor="#CCCCCC">
                <tr>
                  <td bgcolor="#FFFFFF">
                  	<div id="photoTd" style="width: 165px;height: 217px;vertical-align: middle;text-align: center;overflow: hidden;"></div>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td class="bt14A" align="right"><span class="style15">*</span> 策划展单位：</td>
            <td class="bt14A"><input name="auction.planningUnit" type="text" size="35" id="planningUnit"></td>
          </tr>
          <tr>
            <td class="bt14A" align="right"><span class="style15">*</span>拍卖会画册封面：</td>
            <td class="bt14A"><span class="style18"><a id="auctionLink" style="cursor: pointer;color: red">上传</a></span></td>
          </tr>
          <tr>
            <td class="bt14A" align="right">封面拍品名称：</td>
            <td class="bt14A"><input name="auction.coverName" type="text" size="20" id="coverName"></td>
          </tr>
          <tr>
            <td class="bt14A" align="right">参拍作品数量：</td>
            <td class="bt14A"><input name="auction.totalCount" type="text" size="6" id="totalCount"></td>
          </tr>
          <tr>
            <td class="bt14A" align="right"><span class="style15">*</span> 开拍时间：</td>
            <td class="bt14A"><input name="auction.beginningTime" type="text" size="20" id="beginningTime" onClick="WdatePicker({startDate:'%y-%M-%d 00:00:00',dateFmt:'yyyy-MM-dd HH:mm',alwaysUseStartDate:true})"></td>
          </tr>
          <tr>
            <td class="bt14A" align="right"><span class="style15">*</span> 开拍地点：</td>
            <td class="bt14A">
            	<select name="auction.provinceInfo.id" id="provinceInfoSelect" onchange="changeProvince()">
                        <option value="">选择省份</option>
                        <c:forEach items="${provinceInfoList}" var="provinceInfo" varStatus="status">
				            <option value="${ provinceInfo.id}"/> ${ provinceInfo.name}</option>
				        </c:forEach>
                </select>
                <select name="auction.cityInfo.id" id="cityInfoSelect">
                  <option value="">选择县市</option>
                </select>
                <input name="auction.address" type="text" size="40" id="address">
            </td>
          </tr>
          <tr>
            <td class="bt14A" align="right">联系人：</td>
            <td class="bt14A"><input name="auction.contact" type="text" size="20" id="contact"></td>
          </tr>
          <tr>
            <td class="bt14A" align="right">咨询电话：</td>
            <td class="bt14A"><input name="auction.tel" type="text" size="20" id="tel">
            	<!-- 隐藏域 begin -->
		            <input name="auction.imageInfo.id" type="hidden"  id="picImage">
		        <!-- 隐藏域 end --> 
            </td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td width="539" class="nw12a"><img src="../images/an24.gif" width="114" height="31" onClick="javascript:checkForm()" style="cursor: pointer ;border: 0"></td>
          </tr>
</table>

<%@ include file="/member/add_auction_fragment.jsp" %>
</form>

<!--  上传画册图片div begin -->
<div id="uploadImageDiv" style="width: 480px;display: none;vertical-align: top">
	<s:fielderror cssStyle="color:red;font-size:14px;font-family:宋体"/>
	<form action="${ctx }/auction/fileUpload.do?id=${auction.id }" method="post"  id="fileForm" enctype="multipart/form-data">
		<table width="480" align="center" cellpadding="0" cellspacing="0" border="0" style="font-family: 宋体;font-size: 14px;">
			<tr>
				<td height="30" width="30%" align="right">图片文件：</td>
				<td><input type="file" name="myFile" id="myFile"/></td>
			</tr>
			<tr><td align="right" height="30">是否为索引目录：</td>
				<td><input type="radio" name="indexFlag" value="yes"/>是
					<input type="radio" name="indexFlag" value="no" checked="checked"/>否
				</td>
			</tr>
			<tr><td align="right" height="30">图片名称：</td><td><input type="text" name="memo" id="pic_memo"/></td></tr>
			<tr><td height="35"></td><td><input type="button" value="上传" onclick="submitForm()"/></td></tr>
		</table>
	</form>
</div>
<!--  上传画册图片div end -->

<jsp:include page="/commons/foot_member.jsp"></jsp:include>

</body>
</html>